// //
// // Created by feng on 19-4-15.
// //

// #include "rectangleReceiverIntersection.cuh"


// __device__ void rectangleReceiverIntersect::receiver_drawing(RectangleReceiver &rectangleReceiver, const float3 &origin,
//                                                              const float3 &dir, const float3 &normal, float factor,int is_total_reflect,int myId) {
//     // Step 1: Intersect with receiver
//     /* float t, u, v;
//      float *total_reflect=rectangleReceiver.getDeviceTotal();
//      int num=0;
//      if(is_total_reflect){
//          num=1;
//         // printf("    quan =%d\n",num);
//      }
//      //float3 he_re= rectangleReceiver.focus_center_;
//      //printf("%f %f %f\n",he_re.x,he_re.y,he_re.z);
//      atomicAdd(&(total_reflect[myId]),num);*/
//     /* if(!rectangleReceiver.GIntersect(origin, dir, t, u, v)){
//          //printf("不相交\n");
//          //if(is_total_reflect)printf("全反射后打不到接收器上\n");
//          return;
//      }
//      //printf("%d\n",myId);
//      //if(is_total_reflect)printf("全反射 ");
//      // Step 2: Calculate the energy of the light
//      float energy = calEnergy(t, dir, normal, factor);

//      // Step 3: Add the energy to the intersect position
//      // Intersect position
//      v=1-v;

//      if(v<0.5){
//          v+=0.5;
//      }else{
//          v-=0.5;
//      }
//      int2 row_col = make_int2(u * rectangleReceiver.getResolution().y, v * rectangleReceiver.getResolution().x);
//      int address = row_col.x * rectangleReceiver.getResolution().x + row_col.y; // col_row.y + col_row.x * resolution.y

//      float *image = rectangleReceiver.getDeviceImage();
//      atomicAdd(&(image[address]), energy);   //CUDA atomic*/

// }